<template>
  <div class="vivid-typography-container">
    <div>This is some</div>
    <div class="vivid-typography-tooltip-container">
      <span class="vivid-typography-tooltip">
        <slot name="tooltip"></slot>
      </span>
      <div class="vivid-typography-tooltip-text">
        <slot name="text"></slot>
      </div>
    </div>
  </div>
</template>


<style scoped lang="scss">
.vivid-typography-container {
  display: flex;
}

.vivid-typography-container:hover {
  .vivid-typography-tooltip-text {
    color: #cda8d6;
  }
}

.vivid-typography-tooltip-container {
  --background: #750292;
  position: relative;
  cursor: pointer;
  display: flex;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.vivid-typography-tooltip {
  position: absolute;
  left: 50%;
  top: -50%;
  transform: translateX(-50%);
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s;
  color: #fff;
  background: var(--background);
}

.vivid-typography-tooltip::before {
  position: absolute;
  content: "";
  height: 0.6em;
  width: 0.6em;
  bottom: -0.2em;
  left: 50%;
  transform: translate(-20%) rotate(45deg);
  background: var(--background);
}

.vivid-typography-tooltip-container:hover .vivid-typography-tooltip {
  top: -150%;
  border-radius: 0.25em;
  opacity: 1;
  padding: 0.1em 0.5em;
  pointer-events: auto;
  visibility: visible;
}

.vivid-typography-tooltip-text {
  height: fit-content;
  border-bottom: 2px solid var(--background);
}

.vivid-typography-tooltip-text:hover {
  animation: none;
}
</style>
